<%@ page import="com.beans.MenuInfo" %>
<%@ page import="com.dao.MenuDao" %>
<%@ page import="java.util.List" %>
<%@ page import="com.beans.AdminInfo" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script type="text/javascript" src="js/jquery-1.8.0.js"></script>
    <script type="text/javascript" src="js/jquery.easing.js"></script>
    <script type="text/javascript" src="js/jquery.accordion.js"></script>
    <link rel="stylesheet" type="text/css" href="css/menu.css">
    <script>
        $(function(){
            $('#navigation').accordion({
                active:0,
                header: '.head',
                event: 'click',
                fillSpace: true,
                animated: 'bounceslide'
            });
        });
    </script>
</head>
<body>
<%
    AdminInfo admin=(AdminInfo)session.getAttribute("session_admin");
    List<MenuInfo> menuList=new MenuDao().getMenuList(0,admin.getRoleId());
    request.setAttribute("menuList", menuList);//放入数据区
%>
<ul id="navigation">
    <c:forEach var="m" items="${menuList}">
    <li>
        <a class="head">${m.menuName}</a>
        <ul>
            <li>
                <c:forEach var="m_sub" items="${m.subMenuList}">
                    <a target="${m_sub.target }" href="${m_sub.url }"> <img src="images/${m_sub.icon}" /> <label> ${m_sub.menuName } </label></a>	<br />
                </c:forEach>
            </li>
        </ul>
    </li>
    </c:forEach>
    <li> <a class="head">网站前台</a>
        <ul>
            <li><a href="http://localhost:8080/shop-web" target="_blank"><img src="images/main_50.gif" /><label>网站前台</label></a></li>
        </ul>
    </li>

</ul>
</body>
</html>
